package com.sunfeng.chap1;

import java.nio.ByteBuffer;

/**
 * @Author : 孙峰
 * @Description:
 * @Date : 2021/10/8  9:47
 */
public class Test4_1 {
    public static void main(String[] args) {
        ByteBuffer byteBuffer = ByteBuffer.wrap(new byte[]{1, 2, 3});

        byteBuffer.position(1);
        // mark = position
        byteBuffer.mark();
        System.out.println(byteBuffer.position());
        byteBuffer.position(2);
        byteBuffer.reset();

        System.out.println();
        System.out.println(byteBuffer.position());

    }
}
